package com.lzy.elasticserch.canal.consumer.config;

import com.lzy.canal.component.consumer.mysql.DefaultDmlConsumer;
import com.lzy.canal.register.consumer.DmlConsumerRegister;
import com.lzy.elasticserch.canal.consumer.content.FaceConvertService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义任务处理器
 *
 * @author L
 */
@Configuration
//@EnableConfigurationProperties({TenantProperty.class})
public class DmlInsertOrUpdateConsumerRegisterConfig {


    @Bean
    public DmlConsumerRegister consumerRegister(DefaultDmlConsumer defaultDmlConsumer) {
        DmlConsumerRegister register = new DmlConsumerRegister(defaultDmlConsumer);
        // TODO 库名，表名
        register.add("face", "com_staff", faceDataConvertService());
        return register;
    }


    @Bean
    public FaceConvertService faceDataConvertService() {
        return new FaceConvertService();
    }


}
